<?php echo $head?>
<div class="right-content">
    <ul class="nav nav-tabs">
        <li class="active"><a href="./index.php?c=site&amp;a=entry&amp;do=mem&amp;m=junsion_winaward">会员列表</a></li>
    </ul>
    <style>
        th{
            text-align: center !important;
        }
        td{
            text-align: center !important;
            white-space: normal !important;
            word-break: break-all !important;
        }
        .account-stat-num > div{width:50%; float:left; font-size:16px; text-align:center;}
        .account-stat-num > div span{display:block; font-size:30px; font-weight:bold;}
    </style>
    <div class="panel panel-default">
        <div class="panel-heading">
            订单数据统计
        </div>
        <div class="panel-body">
            <div class="account-stat-num row">
                <div>今日会员人数<span>0</span></div>
                <div>总会员人数<span>27331</span></div>
            </div>
        </div>
    </div>
    <form action="" method="get" class="form-horizontal" role="form">
        <div class="panel panel-info">
            <div class="panel-heading">筛选</div>
            <div class="panel-body">
                <input type="hidden" name="c" value="site">
                <input type="hidden" name="a" value="entry">
                <input type="hidden" name="m" value="junsion_winaward">
                <input type="hidden" name="do" value="mem">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">关键字</label>
                    <div class="col-xs-12 col-sm-2 col-lg-2">
                        <input class="form-control" name="keyword" type="text" value="" placeholder="请输入昵称/id">
                    </div>
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">状态</label>
                    <div class="col-xs-12 col-sm-2 col-lg-2">
                        <select name="status" class="form-control">
                            <option value="">全部</option>
                            <option value="0">正常</option>
                            <option value="1">黑名单</option>
                        </select>
                    </div>
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">等级</label>
                    <div class="col-xs-12 col-sm-2 col-lg-2">
                        <select name="lid" class="form-control">
                            <option value="">全部</option>
                            <option value="0">普通会员</option>
                        </select>
                    </div>
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">渠道</label>
                    <div class="col-xs-12 col-sm-2 col-lg-2">
                        <select name="channel_id" class="form-control">
                            <option value="">全部</option>
                            <option value="18">ts2018</option>
                            <option value="17">微博20182018</option>
                            <option value="16">微博2695274515</option>
                            <option value="15">微博6150899802</option>
                            <option value="14">微博6836057026</option>
                            <option value="13">微博6019021832</option>
                            <option value="11">微博6077454353</option>
                            <option value="10">微博6158603374</option>
                            <option value="9">微博6145315945</option>
                            <option value="7">微博6018108760</option>
                            <option value="2">微信</option>
                            <option value="1">微博2018</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label"></label>
                    <div class=" col-xs-12 col-sm-3 col-lg-3">
                        <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                        <a class="btn btn-danger" onclick="$(&quot;#modal-module-menus-pass&quot;).modal()">增加虚假会员数据</a>
                    </div>
                </div>
            </div>
        </div>
    </form>
    <div class="panel panel-default">
        <div class="table-responsive panel-body">
            <table class="table table-hover">
                <thead class="navbar-inner">
                <tr>
                    <th>id</th>
                    <th>昵称</th>
                    <th>头像</th>
                    <th>余额</th>
                    <th>红包<br>总红包</th>
                    <th>等级</th>
                    <th>状态</th>
                    <th>时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody id="mem-list">
                <tr>
                    <td>27337</td>
                    <td>游客670056904</td>
                    <td><img src="http://demo.u1hk3y.cn/attachment/images/1/2018/12/AP0XAMJEZxdPP9DP9M775VwE08X8D5.png" style="width:60px;"></td>
                    <td>0</td>
                    <td>0.00<br>0.00</td>
                    <td><img src="" style="width:60px;"><br></td>
                    <td data-id="27337"><label class="label label-success">正常</label></td>
                    <td>2019-02-11 17:34</td>
                    <td>
                        <a class="btn btn-info btn-sm" href="./index.php?c=site&amp;a=entry&amp;op=credit&amp;id=27337&amp;do=mem&amp;m=junsion_winaward">储值日志</a>
                        <a class="btn btn-warning btn-sm" href="./index.php?c=site&amp;a=entry&amp;op=next&amp;id=27337&amp;do=mem&amp;m=junsion_winaward">我的下线</a>
                        <br>
                        <a class="btn btn-success btn-sm" href="./index.php?c=site&amp;a=entry&amp;op=red&amp;id=27337&amp;do=mem&amp;m=junsion_winaward">红包日志</a>
                        <a class="btn btn-primary btn-sm" onclick="goRecharge('27337',0)">充值余额</a>
                        <br>
                        <a class="btn btn-info btn-sm" href="./index.php?c=site&amp;a=entry&amp;op=score&amp;id=27337&amp;do=mem&amp;m=junsion_winaward">积分日志</a>
                        <a class="btn btn-danger btn-sm" onclick="return confirm('确认删除吗？');return false;" href="./index.php?c=site&amp;a=entry&amp;op=del&amp;id=27337&amp;do=mem&amp;m=junsion_winaward">删除</a>
                    </td>
                </tr>
                </tbody>
            </table>
            <div><ul class="pagination pagination-centered"><li><a href="/web/index.php?c=site&amp;a=entry&amp;eid=13&amp;version_id=0&amp;page=1" class="pager-nav">首页</a></li><li><a href="/web/index.php?c=site&amp;a=entry&amp;eid=13&amp;version_id=0&amp;page=1" class="pager-nav">«上一页</a></li><li class="active"><a href="javascript:;">1</a></li><li><a href="?c=site&amp;a=entry&amp;eid=13&amp;version_id=0&amp;page=2">2</a></li><li><a href="?c=site&amp;a=entry&amp;eid=13&amp;version_id=0&amp;page=3">3</a></li><li><a href="?c=site&amp;a=entry&amp;eid=13&amp;version_id=0&amp;page=4">4</a></li><li><a href="?c=site&amp;a=entry&amp;eid=13&amp;version_id=0&amp;page=5">5</a></li><li><a href="?c=site&amp;a=entry&amp;eid=13&amp;version_id=0&amp;page=6">6</a></li><li><a href="?c=site&amp;a=entry&amp;eid=13&amp;version_id=0&amp;page=7">7</a></li><li><a href="?c=site&amp;a=entry&amp;eid=13&amp;version_id=0&amp;page=8">8</a></li><li><a href="?c=site&amp;a=entry&amp;eid=13&amp;version_id=0&amp;page=9">9</a></li><li><a href="?c=site&amp;a=entry&amp;eid=13&amp;version_id=0&amp;page=10">10</a></li><li><a href="/web/index.php?c=site&amp;a=entry&amp;eid=13&amp;version_id=0&amp;page=2" class="pager-nav">下一页»</a></li><li><a href="/web/index.php?c=site&amp;a=entry&amp;eid=13&amp;version_id=0&amp;page=1367" class="pager-nav">尾页</a></li></ul></div>    </div>
    </div>
    <div id="modal-module-menus-pass" class="modal fade" tabindex="-1" style="z-index: 1030;">
        <div class="modal-dialog" style="width: 520px;">
            <div class="modal-content">
                <div class="modal-header"><button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button><h3>增加虚假会员数据（该功能用于创建排行榜假数据）</h3></div>
                <div class="modal-body">
                    <form action="./index.php?c=site&amp;a=entry&amp;do=addfake&amp;m=junsion_winaward" method="post" class="form-horizontal  form-modal" onsubmit="return confirm('确认添加吗？')">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">添加说明</label>
                            <div class="col-sm-9" style="color: red !important;">
                                虚假会员可单独添加也可以批量增加；如果是批量增加，请在下方填写信息时，多个信息以;隔开；各信息的个数请保持一致
                            </div>
                        </div>
                        <div class="form-group" style="margin-bottom: 50px;">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">昵称</label>
                            <div class="col-sm-9">
                                <input class="form-control" name="name" type="text">
                                <div class="help-block">多个请以;隔开</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">头像</label>
                            <div class="col-sm-9">

                                <script type="text/javascript">
                                    function uploadMultiImage(elm) {
                                        var name = $(elm).next().val();
                                        util.image( "", function(urls){
                                            $.each(urls, function(idx, url){
                                                $(elm).parent().parent().next().append('<div class="multi-item"><img onerror="this.src=\'./resource/images/nopic.jpg\'; this.title=\'图片未找到.\'" src="'+url.url+'" class="img-responsive img-thumbnail"><input type="hidden" name="'+name+'[]" value="'+url.attachment+'"><em class="close" title="删除这张图片" onclick="deleteMultiImage(this)">×</em></div>');
                                            });
                                        }, {"multiple":true,"direct":false,"fileSizeLimit":5120000});
                                    }
                                    function deleteMultiImage(elm){
                                        $(elm).parent().remove();
                                    }
                                </script><div class="input-group">
                                    <input type="text" class="form-control" readonly="readonly" value="" placeholder="批量上传图片" autocomplete="off">
                                    <span class="input-group-btn">
		<button class="btn btn-default" type="button" onclick="uploadMultiImage(this);">选择图片</button>
		<input type="hidden" value="logo">
	</span>
                                </div>
                                <div class="input-group multi-img-details"></div>							<div class="help-block">上传图标 120*120像素最佳</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">累计游戏币奖励</label>
                            <div class="col-sm-9">
                                <input class="form-control" name="credit" type="text">
                                <div class="help-block">多个请以;隔开</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">累计红包佣金奖励</label>
                            <div class="col-sm-9">
                                <input class="form-control" name="red" type="text">
                                <div class="help-block">多个请以;隔开</div>
                            </div>
                        </div>
                        <div class="form-group" style="text-align: center;margin-top: 20px;">
                            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                            <button type="submit" style="margin-left: 50px;" class="btn btn-primary">提交</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <script>
        function changeAgent(obj, mid){
            if(!confirm('确认更改会员代理身份吗？')){
                return false;
            }
            var label = $(obj);
            console.log(mid);
            $.ajax({
                url:"./index.php?c=site&a=entry&op=changeagent&do=mem&m=junsion_winaward",
                type:'post',
                data:{id:mid},
                success:function(status){
                    console.log(status);
                    if(status == '1'){
                        if(label.hasClass('label-success')){
                            label.removeClass('label-success').addClass('label-default');
                            label.text('否');
                        }else{
                            label.removeClass('label-default').addClass('label-success');
                            label.text('是');
                        }
                    }
                }
            });
        }
        $('table label').click(function(){
            var label = $(this);
            $.ajax({
                url:"./index.php?c=site&a=entry&op=status&do=mem&m=junsion_winaward",
                type:'post',
                data:{id:label.parent().attr('data-id')},
                success:function(status){
                    if(status == '1'){
                        if(label.hasClass('label-success')){
                            label.removeClass('label-success').addClass('label-default');
                            label.text('黑名单');
                        }else{
                            label.removeClass('label-default').addClass('label-success');
                            label.text('正常');
                        }
                    }
                }
            });
        });
    </script>
    <style>
        .check_bg{
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,.5);
            position: fixed;
            top: 0;
            left: 0;
            z-index: 99;
            display: none;
        }
        .check_main{
            width: 40%;
            height: auto;
            background: #fff;
            position: fixed;
            top: 150px;
            left: 30%;
            border-radius: 5px;
        }
        .check_main>textarea{
            width: 80%;
            margin-left: 10%;
            margin-top: 0px;
            height: 100px;
            border-radius: 5px;
        }
        .check_main>button{
            display: block;
            margin-top: 10px;
            border: none;
            border-radius: 5px;
            height: 34px;
            width: 80%;
            margin-left: 10%;
            margin-bottom: 20px;
            background: #5bc0de;
            color: #fff;
        }
        .check_main .title{
            text-align: center;
            height: 50px;
            line-height: 50px;
            font-size: 18px;
            font-weight: bold;
        }
        .check_close{
            position: fixed;
            left: 68.5%;
            margin-top: 10px;
            font-size: 16px;
        }
        .control-label{
            text-align: right;
        }
    </style>
    <div class="check_bg">
        <div class="check_main">
            <span class="check_close" onclick="hideBg();">X</span>
            <div class="title" id="mtitle">余额充值</div>
            <div class="panel panel-info">
                <div class="panel-body">
                    <div class="form-group" id="islevel">
                        <label class="col-xs-12 col-sm-4 col-md-3 control-label">会员等级</label>
                        <div class="col-xs-12 col-sm-8 col-lg-8">
                            <select id="lid" class="form-control">
                                <option value="0">普通会员</option>
                            </select>
                        </div>
                    </div>
                    <div class="info_level" id="isrecharge">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-4 col-md-3 control-label">金额</label>
                            <div class="col-xs-12 col-sm-8 col-lg-8">
                                <input class="form-control infoearn" name="money" id="money" type="number" placeholder="请输入充值金额">
                            </div>
                        </div>
                        <span class="help-block" style="text-align: center;">金额大于0为增加会员余额，小于0为减少会员余额</span>
                    </div>
                </div>
            </div>
            <button id="check_btn" onclick="doRecharge();">提交</button>
        </div>
    </div>
    <script>
        var rmid = 0;
        var type = 0;
        function goRecharge(oid, otype){
            rmid = oid;
            type = otype;
            if(type == 0){
                $('#isrecharge').show();
                $('#islevel').hide();
                $('#mtitle').text('余额充值');
            }
            else{
                $('#islevel').show();
                $('#isrecharge').hide();
                $('#mtitle').text('请选择会员等级');
            }
            $('.check_bg').show();
            $('#money').val('');
        }
        function hideBg(){
            $('.check_bg').hide();
            rmid = 0;
        }
        function doRecharge(){
            var money = 0;
            var lid = 0;
            if(type == 0){
                money = $('#money').val();
                if(!money || money==0){
                    alert('请输入充值金额');
                    return false;
                }
                var url = "./index.php?c=site&a=entry&op=recharge&do=mem&m=junsion_winaward";
                var msg = '确认充值吗？';
            }
            else{
                lid = $('#lid').val();
                var url = "./index.php?c=site&a=entry&op=level&do=mem&m=junsion_winaward";
                var msg = '确认更改会员等级吗？';
            }
            if(rmid==0){
                alert('请选择会员');
                return false;
            }
            if(!confirm(msg))return false;
            $.ajax({
                url: url,
                type: 'post',
                data: {id: rmid,money: money, lid: lid},
                success(data){
                    if(data!='1'){
                        alert(data);
                    }
                    else{
                        alert('操作成功');
                        window.location.reload();
                    }
                }
            });
        }
    </script>
</div>